1. /* srofdvdb.cpp by K.Tsuru */
  2. // function ID = 825 BRADIX
  3. /*******************************
  4. SRational class
  5. (N/D)/d = N/(D*d)
  6. ********************************/
  7. #ifndef SN_H
  8. #include "sn.h"
  9. #endif
  10. // m/d
  11. SRational operator/(const SRational& m, double d){
  12. if(d == 0.0) m.num.SetError(m.num.DIVIDED_BY_ZERO,"SR/double", 825);
  13. SRational r;
  14. if( !m.Sign(825) ) r.SetZero();
  15. else if(d == 1.0L) r = m;
  16. else if(d == -1.0L) r = -m;
  17. else r.Set(m.NumNR(), m.DenNR()*(SInteger)d); // includes r.reduce(false);
  18. return r;
  19. }

srofdvdb.cpp : last modifiled at 2016/06/26 16:29:28(541 bytes)
created at 2016/06/26 15:57:35
The creation time of this html file is 2016/09/18 20:28:05 (Sun Sep 18 20:28:05 2016).